﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TeleRad.DBContext;
using TeleRad.Entities;


namespace TeleRad.DbContext
{
    public class CoreDataIntializer : System.Data.Entity.DropCreateDatabaseIfModelChanges<CoreDBContext>
    {
        protected override void Seed(CoreDBContext context)
        {
            var initagent = new List<PatientInfo> {
                new PatientInfo
                {
                    Id=1,
                    UserName="sam",
                    Name="Shashank Tiwary",
                    Password="sam",
                    Age="23 years old",
                    Sex="Male",
                    CompanyCode=1,
                    ViewsNumber=200
                },
                new PatientInfo
                {
                    Id=2,
                    UserName="nancy",
                    Name="Nancy Remo",
                    Password="remo",
                    Age="31 years old",
                    Sex="Female",
                    CompanyCode=1,
                    ViewsNumber=100
                }
            };
            initagent.ForEach(p => context.Set<PatientInfo>().Add(p));
            context.SaveChanges();
        }
    }

}
